home *** CD-ROM | disk | FTP | other *** search
/ ADA Programming Guide / ADA Programming Guide.iso / ada_gnu / adainc / s-pooloc.ads < prev    next >
Text File  |  1996-01-30  |  3KB  |  71 lines

  1. ------------------------------------------------------------------------------
  2. --                                                                          --
  3. --                         GNAT COMPILER COMPONENTS                         --
  4. --                                                                          --
  5. --                    S Y S T E M . P O O L _ L O C A L                     --
  6. --                                                                          --
  7. --                                 S p e c                                  --
  8. --                                                                          --
  9. --                            $Revision: 1.4 $                              --
  10. --                                                                          --
  11. --           Copyright (c) 1992,1993,1994 NYU, All Rights Reserved          --
  12. --                                                                          --
  13. -- The GNAT library is free software; you can redistribute it and/or modify --
  14. -- it under terms of the GNU Library General Public License as published by --
  15. -- the Free Software  Foundation; either version 2, or (at your option) any --
  16. -- later version.  The GNAT library is distributed in the hope that it will --
  17. -- be useful, but WITHOUT ANY WARRANTY;  without even  the implied warranty --
  18. -- of MERCHANTABILITY  or  FITNESS FOR  A PARTICULAR PURPOSE.  See the  GNU --
  19. -- Library  General  Public  License for  more  details.  You  should  have --
  20. -- received  a copy of the GNU  Library  General Public License  along with --
  21. -- the GNAT library;  see the file  COPYING.LIB.  If not, write to the Free --
  22. -- Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.        --
  23. --                                                                          --
  24. ------------------------------------------------------------------------------
  25.  
  26. with System.Storage_Pools;
  27. with System.Storage_Elements;
  28. with System.Pool_Global;
  29.  
  30. package System.Pool_Local is
  31.  
  32. pragma Elaborate_Body;
  33. --  Needed to ensure that library routines can execute allocators
  34.  
  35.    ----------------------------
  36.    -- Unbounded_Reclaim_Pool --
  37.    ----------------------------
  38.  
  39.    --  Allocation strategy:
  40.  
  41.    --    Call to malloc/free for each Allocate/Deallocate
  42.    --    no user specifiable size
  43.    --    Space of allocated objects is reclaimed at pool finalization
  44.    --    Manages a list of allocated objects
  45.  
  46.    --  Default pool in the compiler for access types locally declared
  47.  
  48.    type Unbounded_Reclaim_Pool is new
  49.      System.Pool_Global.Unbounded_No_Reclaim_Pool with
  50.        record
  51.           First : System.Address := Null_Address;
  52.        end record;
  53.  
  54.    --  function Storage_Size is inherited
  55.  
  56.    procedure Allocate
  57.      (Pool         : in out Unbounded_Reclaim_Pool;
  58.       Address      : out System.Address;
  59.       Storage_Size : System.Storage_Elements.Storage_Count;
  60.       Alignment    : System.Storage_Elements.Storage_Count);
  61.  
  62.    procedure Deallocate
  63.      (Pool         : in out Unbounded_Reclaim_Pool;
  64.       Address      : System.Address;
  65.       Storage_Size : System.Storage_Elements.Storage_Count;
  66.       Alignment    : System.Storage_Elements.Storage_Count);
  67.  
  68.    procedure Finalize (Pool : in out Unbounded_Reclaim_Pool);
  69.  
  70. end System.Pool_Local;
  71.